<?php

include 'class.php';

if ($_GET['module']<>"" && $_GET['action']=="delete" && $_GET['id']<>"")
{
	$module = $sql->escape($_GET['module']);
	
	include 'settings/'.$module."_db.php";
	
	if ($module_db['multitable'])
	{
		$module_db = $module_db[$_GET['table']];
	}
	
	$user->get_user_perm($module);
	
	$id = (int)$_GET['id'];
	
	if ($sql->mysql_delete($module_db['table_name'],"`".$module_db['id']."` = ".$id))
	{
		$_SESSION['message']['highlight'][] = "Adatok sikeresen törölve lettek az adatbázisból!";
	}
	
	
	if ($_GET['subpage']<>"")
	{
		$module = "?".$module.".".$sql->escape($_GET['subpage']);
	}
	else
	{
		$module = "?".$module.".list";
	}
	
}
else
{
	$_SESSION['message']['error'][] = "Hibásan megadott paraméterek!";
}

header("Location: index.php".$module);

?>